ghacks-clear-all-up-to-57-[RFP-alternatives].js 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. /***
  2. This will reset the preferences that are under section 4600 in the ghacks user.js
  3. up to and including release 57-alpha. These are the prefs that are no longer
  4. necessary, or they conlfict with, privacy.resistFingerprinting if you have that enabled.
  5. For instructions see:
  6. https://github.com/ghacksuserjs/ghacks-user.js/wiki/1.6-Bulk-Pref-Resetting-[Scratchpad]
  7. ***/
  8. (function() {
  9. let ops = [
  10. '_user.js.parrot',
  11. /* */
  12. 'dom.maxHardwareConcurrency',
  13. 'dom.enable_resource_timing',
  14. 'dom.enable_performance',
  15. 'device.sensors.enabled',
  16. 'browser.zoom.siteSpecific',
  17. 'dom.gamepad.enabled',
  18. 'dom.netinfo.enabled',
  19. 'media.webspeech.synth.enabled',
  20. 'geo.enabled',
  21. 'media.video_stats.enabled',
  22. 'dom.w3c_touch_events.enabled'
  23. ]
  24. if("undefined" === typeof(Services)) {
  25. alert("about:config needs to be the active tab!");
  26. return;
  27. }
  28. let c = 0;
  29. for (let i = 0, len = ops.length; i < len; i++) {
  30. if (Services.prefs.prefHasUserValue(ops[i])) {
  31. Services.prefs.clearUserPref(ops[i]);
  32. if (!Services.prefs.prefHasUserValue(ops[i])) {
  33. console.log("reset", ops[i]);
  34. c++;
  35. } else { console.log("failed to reset", ops[i]); }
  36. }
  37. }
  38. focus();
  39. let d = (c==1) ? " pref" : " prefs";
  40. if (c > 0) {
  41. alert("successfully reset " + c + d + "\n\nfor details check the Browser Console (Ctrl+Shift+J)");
  42. } else { alert("nothing to reset"); }
  43. })();